<template>
	<scroll ref="mescrollRef" @init="mescrollInit" :down="downOption" @down="downCallback" :up="upOption" @up="upCallback"
	 @emptyclick="emptyClick">
		<stop>
			<block slot="content">我的消息</block>
		</stop>
		<!-- <view class="mart3">
			<view class="list-style-1">消息列表</view>
		</view> -->
		<view class="">
			<view class="mart5" v-for="(item,index) in lists" :key="index">
				<view class="flrc pad1 fs8">{{datetime(item.createAt)}}</view>
				<view class="bcf pad2 round5 shadow-blur marlr2 mart1">
					<view class="lh2 pad1 flrc">
						<view class="flex1 fwb">{{item.title}}</view>
						<!-- <view v-if="$com.isbool(item.isToAll)" class="fa fa-users c12 op3"></view> -->
						<!-- <view v-if="!$com.isbool(item.isToAll)" class="fa fa-user c12 op3"></view> -->
					</view>
					<view class="bdtso pad3 bc13 c12 lh2">
						{{item.content}}
					</view>
					<view class="mart3 pos-r bdtda" v-if="item.params != null" @tap="goto(item.params.url)">
						<view class="flrc pad2 bdbda" v-for="value,key in item.params.data">
							<view class="flex1">{{key}} ：</view>
							<view class="">{{value}}</view>
						</view>
						<view class="tac pad2 text-cyan">点击查看</view>
						<ripple></ripple>
					</view>
				</view>
			</view>
		</view>
		<loading :loading="myIsLoading"></loading>
	</scroll>
</template>

<script>
	import MescrollMixin from "@/components/mescroll-uni/mescroll-mixins.js";
	import List from '../../../assets/js/list.js'
	export default {
		mixins:[MescrollMixin],
		data() {
			let list = new List()
			return {
				list,
				lists: [],
				
				where: {
					eq: {
						status: '',
						emergency: '',
						level: '',
					}
				},
				search: ""
			}
		},
		methods: {
		},
		created() {

		},
		mounted() {
			this.list.initMescroll(this).setUrl('/api/my/messages').setData({
				_order: {id:"DESC"},
				_where: this.where,
				_search: this.search,
			}).setCbFunc(res => {
				this.lists = res
				this.clearLoading()
				// this.mescroll.endErr()
			}).reload()
		},
		onShow() {
			this.log("onshow")
			this.showLoading()
			this.list.reload()
		},
	}
</script>

<style>

</style>
